CC:=clang++
CLANG++VERSION:=$(shell clang++ -dumpversion)
CFLAGS = -g

TESTS:=$(wildcard tests/*.cpp)
EXES:=$(TESTS:.cpp=)

%: %.cpp
	$(CC) -D__DEBUG__=1 -std=c++11 $< -o $@

ifneq "$(CLANG++VERSION)" "4.2.1"
	$(error "Must use CLANG 4.2.1 build using g++-4.7.2")
endif

all: $(EXES)

test: $(EXES)
	rm -f tests/test.log
	for c in $(EXES); do \
		echo "Testing " ./$$c >> tests/test.log; \
		echo -n "Testing " ./$$c ; \
		./$$c >> tests/test.log ; \
		if [ $$? -eq 0 ] ; then echo "\t -> PASSED" ; fi \
	done


clean:
	rm -f $(EXES) *~ tests/*~ tests/*log